package main

import (
	"fmt"
)

func main() {

	s1 := []int{1, 2, 3, 4, 5}
	fmt.Printf("slice s1 : %v\n", s1)

	s2 := s1[0:2]
	fmt.Println("slice s2 : ", s2)

	s3 := s1[1:3]
	fmt.Println("slice s3 :", s3)

	s2[1] = 1000

	fmt.Println(s1)
	fmt.Println(s2)
	fmt.Println(s3)
	//s2 := make([]int, 10)
	//fmt.Printf("slice s2 : %v\n", s2)
	//copy(s2, s1)
	//fmt.Printf("copied slice s1 : %v\n", s1)
	//fmt.Printf("copied slice s2 : %v\n", s2)
	//s3 := []int{1, 2, 3}
	//fmt.Printf("slice s3 : %v\n", s3)
	//s3 = append(s3, s2...)
	//fmt.Printf("appended slice s3 : %v\n", s3)
	//s3 = append(s3, 4, 5, 6)
	//fmt.Printf("last slice s3 : %v\n", s3)

	//str := "Hello,world"
	//strBytes := []byte(str)
	//strBytes[0] = 'M'
	//str = string(strBytes)
	////s := []byte(str)
	////s[6] = 'G'
	////s = s[:8]
	////s = append(s, '!')
	////str = string(s)
	//fmt.Println(str)

	str := "你好，世界！Hello,world! "
	s := []rune(str)
	s[3] = '够'
	s[4] = '浪'
	str = string(s)
	fmt.Println(str)

	slice := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	d1 := slice[6:8]
	fmt.Println(d1, len(d1), cap(d1))

	d2 := slice[:6:8]
	fmt.Println(d2, len(d2), cap(d2))
}
